package com.oop;

public class Test8 {
    public static void main(String[] args) {
        Cat cat = new Cat("小黄", 5);
        cat.info();
        Cat cat1 = new Cat();

    }
}

class Cat{
    public String name;
    public int age;
    public Cat(String Name,int Age){//构造方法
        name=Name;
        age=Age;
    }
    public Cat(){
    }

    public void info(){//打印对象信息
        System.out.println("name="+name+" age="+age);
    }
}
